package com.ask.forMe.langchain4j.agent;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import reactor.core.publisher.Flux;

import static dev.langchain4j.service.spring.AiServiceWiringMode.EXPLICIT;

@AiService(
        wiringMode = EXPLICIT,
        chatModel = "qwenChatModel",
        streamingChatModel = "qwenStreamingChatModel",
        chatMemoryProvider = "chatMemoryProviderNoDuration",
        tools = "xiaozhiAgentTools",
        //contentRetriever = "contentRetrieverXiaozhi" // 默认的检索器，从本地内存加载文件
        contentRetriever = "contentRetrieverXiaozhiPincone" // 从pinecone向量数据库检索
)
public interface XiaozhiAgent {
    @SystemMessage(fromResource = "xiaozhi-prompt-template.txt")
    String chat(@MemoryId String memoryId, @UserMessage String message);

    @SystemMessage(fromResource = "xiaozhi-prompt-template.txt")
    //Flux<String> stream(@MemoryId Long memoryId, @UserMessage String message);
    String stream(@MemoryId String memoryId, @UserMessage String message);

}
